<div class="page-body">

    <a class="btn btn-default maroon" style="margin-bottom: 15px;">
        <form action="{:U('import')}" method="post" enctype="multipart/form-data">
            <input type="file" name="excel" style="display: inline">
            <input type="submit" value="确认导入-新增" />
            <span>注:此处导入只会批量新增会员!</span>
        </form>
    </a>
    <br>
    <a class="btn btn-default maroon" style="margin-bottom: 15px;">
        <form action="{:U('importDeposit')}" method="post" enctype="multipart/form-data">
            <input type="file" name="excel" style="display: inline">
            <input type="submit" value="确认导入-新增" />
            <span>注:此处导入只会批量进行会员卡充值!</span>
        </form>
    </a>

    <div class="row">
        <div class="col-xs-12 col-md-12">
            <div class="widget">
                <div class="widget-header ">
                    <span class="widget-caption">会员卡列表</span>
                    <div class="widget-buttons">
                        <a href="#" data-toggle="maximize">
                            <i class="fa fa-expand"></i>
                        </a>
                        <a href="#" data-toggle="collapse">
                            <i class="fa fa-minus"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="table-toolbar">
                        <form method="get" action="{:U('index')}" class="form-inline" role="form">
                            <div class="form-group">
                                <span class="input-icon" style="width: 200px;">
                                    <input type="text" class="form-control input-sm" placeholder="卡号、手机号"
                                           name="keywords" value="{$Think.get.keywords}">
                                    <i class="glyphicon glyphicon-search blue"></i>
                                </span>
                                <div class="input-group">
                                    会员:
                                    <select name="valid">
                                        <option value="0">全部</option>
                                        <option value="1" <eq name="Think.get.valid" value="1">selected=selected</eq> >有效</option>
                                        <option value="2" <eq name="Think.get.valid" value="2">selected=selected</eq> >无效</option>
                                    </select>
                                </div>
                                <button type="submit" class="btn btn-info">搜索</button>

                                <a href="{:U('export')}" class="btn btn-danger">会员卡导出</a>

                            </div>
                        </form>
                    </div>

                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>
                                ID（卡号）
                            </th>
                            <th>
                                关联用户
                            </th>
                            <th>
                                会员卡到期时间
                            </th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="data" id="vo">
                            <tr>
                                <td>{$vo.card_id}</td>
                                <td>
                                    <notempty name="vo.user">
                                        <a href="{:U('User/index',['user_id'=>$vo['user']['user_id']])}">
                                            <a class="show_headimg">显示头像<img src="{$vo.user.headimgurl}" height="100"></a><br>
                                            {$vo.user.nickname}
                                        </a>
                                    </notempty>
                                </td>
                                <td>
                                    {$vo.expire_time}
                                    <if condition="$vo.expire_time gt date('Y-m-d H:i:s')">
                                        <span class="label label-darkorange">有效</span>
                                        <else/>
                                        <span class="label label-default">无效</span>
                                    </if>
                                    <if condition="$vo.is_lock eq 0">

                                        <else/>
                                        <br><span class="label label-darkpink graded">已冻结</span>
                                    </if>
                                </td>
                                <td>

                                    <!--<a class="btn btn-success btn-xs"-->
                                       <!--href="{:U('edit',array('card_id'=>$vo['card_id']))}">-->
                                        <!--<i class="fa fa-edit"></i> 编辑-->
                                    <!--</a>-->


                                    <if condition="$vo.is_lock eq 0">
                                        <a class="btn btn-danger btn-xs action-btn" href="javascript:;"
                                           data-href="{:U('lock',array('card_id'=>$vo['card_id']))}">
                                            <i class="fa fa-times"></i> 冻结
                                        </a>
                                        <else/>
                                        <a class="btn btn-blue btn-xs action-btn" href="javascript:;"
                                           data-href="{:U('unlock',array('card_id'=>$vo['card_id']))}">
                                            <i class="fa fa-times"></i> 解冻
                                        </a>
                                    </if>

                                    <a class="btn btn-warning btn-xs action-btn" href="javascript:;"
                                       data-href="{:U('cancel',array('card_id'=>$vo['card_id']))}">
                                        <i class="glyphicon glyphicon-log-out"></i> 注销
                                    </a>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    {$page}
                </div>
            </div>
        </div>
    </div>
</div>